package com.wang.controller;

import com.wang.entity.Complaint;
import com.wang.service.ComplaintService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.util.List;

@RestController
@RequestMapping("/complaint")
public class ComplaintController {
    @Resource
    private ComplaintService complaintService;
    @RequestMapping("/get")
    public List<Complaint> getComplaint(String content, LocalDateTime startDate, LocalDateTime endDate) {
        return complaintService.getComplaint(content, startDate, endDate);
    }
    @RequestMapping("/update")
    public void updateComplaint(Complaint complaint) {
        complaintService.updateComplaint(complaint);
    }
}
